package org.polaris.gift.domain;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import org.junit.Test;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author polaris
 * @since 2023-06-20
 */
public class Employee extends Model<Employee> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 性别 (1是男 0是女 2是保密)
     */
    private Integer sex;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 部门
     */
    @TableField("dep_id")
    private String depId;
    /**
     * 电话
     */
    private String tel;
    /**
     * 住址
     */
    private String address;

    @TableField("department")
    private Department department;

    public Employee() {
    }

    public Employee(Long id, String name, Integer sex, Integer age, String depId, String tel, String address, Department department) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.depId = depId;
        this.tel = tel;
        this.address = address;
        this.department = department;
    }

    public Employee(String name, Integer sex, Integer age, String depId, String tel, String address, Department department) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.depId = depId;
        this.tel = tel;
        this.address = address;
        this.department = department;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", depId='" + depId + '\'' +
                ", tel='" + tel + '\'' +
                ", address='" + address + '\'' +
                ", department=" + department +
                '}';
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
